﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////

// Reviewed?

#pragma once
#include "GcmpRenderingInterface.h"
#include "Color.h"
#include "Vector3d.h"
#include <string>
#include "NdbDataSchema.h"

namespace gcmp
{
    /// \brief 光照类型
    SERIALIZABLE_ENUM_CLASS(LightType)
    {
        None = 0,          ///<无效的类型
        Point = 1,          ///<点光源
        Directional = 2,  ///<方向光源
        Spot = 3     ///<探照光源
    };

    /// \brief 阴影属性相关的接口类
    class GCMP_RENDERING_INTERFACE_EXPORT IShadowOptions
    {
    public:
        /// \brief 析构函数
        virtual ~IShadowOptions() {}

        /// \brief 打开阴影功能
        /// \return 
        /// \note 设置完成后需要调用UiView的MarkNeedRebuild和Refresh函数刷新视图, 否则阴影效果无效
        /// 如 gcmp::IUiView* m_uiView
        /// m_uiView->MarkNeedRebuild(true);
        /// m_uiView->Refresh();
        virtual void EnableShadow() = 0;

        /// \brief 关闭阴影
        /// \return 
        /// \note 设置完成后需要调用UiView的MarkNeedRebuild和Refresh函数刷新视图, 否则阴影效果无效
        /// 如 gcmp::IUiView* m_uiView
        /// m_uiView->MarkNeedRebuild(true);
        /// m_uiView->Refresh();
        virtual void DisableShadow() = 0;

        /// \brief 获取阴影的状态
        /// \return true,阴影功能已打开；false，阴影功能已关闭
        virtual bool IsShadowEnabled() const = 0;

        /// \brief 设置光照类型
        /// \param type 光照类型
        /// \return 
        virtual void SetLightType(LightType type) = 0;

        /// \brief 获取光照类型
        /// \return 返回光照类型
        virtual LightType GetLightType() const = 0;

        /// \brief 设置光源的位置
        /// \param position 太阳的位置
        /// \return 
        /// \note 光照类型为LightType::Directional时，设置位置无效
        virtual void SetLightPosition(const Vector3d& position) = 0;

        /// \brief 获取光源的位置
        /// \return 光源的位置
        virtual  Vector3d GetLightPosition() const = 0;

        /// \brief 设置光源的方向
        /// \param direction 光源的方向
        /// \return 
        virtual void SetLightDirection(const Vector3d& direction) = 0;

        /// \brief 获取光源的方向
        /// \return 光源的方向
        virtual Vector3d GetLightDirection() const = 0;
    };
    
}

